﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<GabageFactory.Models.Modification_apply>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	申请修改数据
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% using (Html.BeginForm("Edit", "Modification", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {%>
        <%= Html.ValidationSummary(true) %>
        <%= Html.HiddenFor(model => model.id) %>
            
    <table class="tableCss" cellspacing="0" cellpadding="0" align="center" border="0" style="margin-top:10px">
        <tr>
            <th colspan="2" class="heightrow" align="left" style="padding:10px">
                申请修改数据
            </th>
        </tr>
        <tr>
           <td class="row1" align="center">申请类型</td>
           <td class="row1" align="left">
                <input type="radio" name="type" <%if (Model.type == 1){ %>checked="checked"<%} %> value="1" id="simple" onclick="applySimpleChange();" />申请修改少量历史数据
                <input type="radio" name="type" <%if (Model.type == 2){ %>checked="checked"<%} %> value="2" id="missed" onclick="applyMissedChange();" style="margin-left:20px" />申请历史数据的补录
                <%= Html.ValidationMessageFor(model => model.type) %>
           </td>
        </tr>
        <tr>
           <td class="row1" align="center" valign="top">申请标题</td>
           <td class="row1" align="left">
                <%= Html.TextBoxFor(model => model.title)%>
                <%= Html.ValidationMessageFor(model => model.title) %>
           </td>
        </tr>
        <tr>
           <td class="row1" align="center" valign="top">申请内容</td>
           <td class="row1" align="left">
                <%= Html.TextAreaFor(model => model.content, new { cols=50, rows=10, id="content"})%>
                <%= Html.ValidationMessageFor(model => model.content) %>
           </td>
        </tr>
        <tr id="missedFile" <%if (Model.type == 1){ %>style="display:none"<%} %>>
           <td class="row1" align="center" valign="top">补录数据</td>
           <td class="row1" align="left">
                <input type="file" name="file" value="<%=Model.file %>" />
                <%= Html.ValidationMessageFor(model => model.file) %>
           </td>
        </tr>
    </table>
    
    <div style="margin-top:25px;text-align:center">
        <input type="submit" value="提    交" style="font-size:16px;font-weight:bold" />
    </div>
    <% } %>

    <script type="text/javascript" language="javascript">
        function applySimpleChange() {
            $("#missedFile").css("display", "none");
            var str = "申请将________年____月____日上报的________________堆场/尾矿库的________数据进行修改。原测量数据为_________，现重新测量后的数据为________。";
            $("#content").val(str);
        }

        function applyMissedChange() {
            var str = "由于________________________________________________的原因，________年____月____日的数据没有及时上报，现上传该日的补录数据文件。";
            $("#content").val(str);
            $("#missedFile").css("display", "");
        }
    </script>
</asp:Content>
